UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'suDCtkNTEvjUWIGwZRb+louMaDIoohwjLdfwhZrF7wY=' 
WHERE 
  key_id = 'e9cf4c171f91cc7eb21dc5c3b75939f5b3ee03fb33aace9b212600eeb0dc68dc' 
  AND (
    token = 'suDCtkNTEvjUWIGwZRb+louMaDIoohwjLdfwhZrF7wY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023