UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A9x3LfkNhs2NmsM6j4d+eyY7sf/nc5pK8/GGSw++YxQ=' 
WHERE 
  key_id = '2ec537883bca6620fc3b7453dd8d4faf59aafb8701bb0f768e53286610aade73' 
  AND (
    token = 'A9x3LfkNhs2NmsM6j4d+eyY7sf/nc5pK8/GGSw++YxQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043