UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LNDBdo+3IdYGHO8dl1c/tKV7h5BB1/+E2SjgU05vShE=' 
WHERE 
  key_id = '14a5aa9254ba9fbb3921a469ffac7ddc7b22f679e7952abe542ab350bba9f138' 
  AND (
    token = 'LNDBdo+3IdYGHO8dl1c/tKV7h5BB1/+E2SjgU05vShE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069