UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tkxYEGSwgwkSLzxRrArcSR8opM2a3z3pK9dWhDJbRuE=' 
WHERE 
  key_id = 'ba1702b792b839a4180e54c66570cad40c2513b1d2fe6d5d32c36fb1cdf5e70d' 
  AND (
    token = 'tkxYEGSwgwkSLzxRrArcSR8opM2a3z3pK9dWhDJbRuE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045