UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NaqvoyAmJ3YzCYFPTgcMnnQYYhnrK7Gw/iDHfGSl7KU=' 
WHERE 
  key_id = '1ac3fd0ac5d8c5ff3d4ad05f5e5b354f7d6b8dd2dbfbbe6815d85ad823b75e19' 
  AND (
    token = 'NaqvoyAmJ3YzCYFPTgcMnnQYYhnrK7Gw/iDHfGSl7KU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039