UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hXShOef3OZVCSzfDYF8Ggg3MfddxP+nDeUYb3K2TfKY=' 
WHERE 
  key_id = '251df22fc566ff60935bacbfb441f99976eea1ed13201eb83288c537a48641c1' 
  AND (
    token = 'hXShOef3OZVCSzfDYF8Ggg3MfddxP+nDeUYb3K2TfKY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026