UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PYZfiL6zWku+XQIMdPaBGSPnZSMBBKQRBgUzZzhySr0=' 
WHERE 
  key_id = '496f6ffc066a1c1d87f65fd2cb7fd24f79677e71a57454971d38b3993729f4e6' 
  AND (
    token = 'PYZfiL6zWku+XQIMdPaBGSPnZSMBBKQRBgUzZzhySr0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041