UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uB6MzyAcBdI/2BFg5eGnbf7at+8VqDt2LaHkgQwAWXY=' 
WHERE 
  key_id = '68c5f514797d74c9b52ccb81070f4b71501818a68387ddf9c5329583afb9fb4e' 
  AND (
    token = 'uB6MzyAcBdI/2BFg5eGnbf7at+8VqDt2LaHkgQwAWXY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035