UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nVkvYkWjDD1c6RMq5e+CgXl7KaX58c/21DyXpHEEHIc=' 
WHERE 
  key_id = 'ecbf94724fe2148c56b58ad9ee2add45d35831637508fe3c5989f22f4e22b422' 
  AND (
    token = 'nVkvYkWjDD1c6RMq5e+CgXl7KaX58c/21DyXpHEEHIc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039