UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XEAj+6kDnREyDebvfw19sFHW20jUFK5RkocM1LQCvLs=' 
WHERE 
  key_id = '001d0c230385ddadd28a5307f0055c13c75dc6bd16c3fdc37a7fef22e420aec2' 
  AND (
    token = 'XEAj+6kDnREyDebvfw19sFHW20jUFK5RkocM1LQCvLs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042