UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U4I2A+p+cPqX89LDNm5nJy8wVJxrpKlIkF0zhLRviHo=' 
WHERE 
  key_id = '3fb3d6001457ea89f210bf2b18f1c1e91a8a5b8ecb23876bc328bf9253e0d660' 
  AND (
    token = 'U4I2A+p+cPqX89LDNm5nJy8wVJxrpKlIkF0zhLRviHo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029