UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V0EfSUqKKTPy7O4h7ESS+LHZ+B4ptWSDoHFEVf61uwQ=' 
WHERE 
  key_id = 'ce9bc18abdcaf440d3dad504952eca985a6c47b1c88131091f1ce1c627458dc4' 
  AND (
    token = 'V0EfSUqKKTPy7O4h7ESS+LHZ+B4ptWSDoHFEVf61uwQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045