UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FypDMJQ8RjZqYDUbHVrmzsI44vS+11S2wRhNJiB78e4=' 
WHERE 
  key_id = '34ba5acf8a62d2fff33c86ad25e7b1d86f58071fd98c898345215b8e0ffa4b46' 
  AND (
    token = 'FypDMJQ8RjZqYDUbHVrmzsI44vS+11S2wRhNJiB78e4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031