UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IFMhFQ8WOkbI1kHb6/NQmASid9HPaRhMlYFZPaEonbo=' 
WHERE 
  key_id = 'f9d635cb3a2c195bbc93922d59c68f4e1c7e8525ee517a04b0d851a048e5eac5' 
  AND (
    token = 'IFMhFQ8WOkbI1kHb6/NQmASid9HPaRhMlYFZPaEonbo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044