UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xevWQNECDWxcTLJ9VmZPpzqOgC9m9O+FS9/tz3gfcf8=' 
WHERE 
  key_id = 'b40ca8c981c187444c4d26e16cd59cb301f9af43ebb7bee9344f6485cfb58d3c' 
  AND (
    token = 'xevWQNECDWxcTLJ9VmZPpzqOgC9m9O+FS9/tz3gfcf8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036