UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KWM6IPYDiekLKYPYlEU7b6DTYYyR1RjwgilJtnBvRrM=' 
WHERE 
  key_id = 'bc90f3dad4f9f5fa7e9ba4a64ac3eff8a2be1a332910c84a0f60566292cee8ed' 
  AND (
    token = 'KWM6IPYDiekLKYPYlEU7b6DTYYyR1RjwgilJtnBvRrM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055