UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q/1W8KDTneNlRL+G7k6VvGHCKpJmXxxRVUSfBk10498=' 
WHERE 
  key_id = '77b47c96e1be3a66b452f7d4c5aab03baa1f735fbec9ded54ec1c1c27c05ca88' 
  AND (
    token = 'Q/1W8KDTneNlRL+G7k6VvGHCKpJmXxxRVUSfBk10498=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037