UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zWxsGo8o0ny5Tbyd7XQxr3PgA3A7q3cC5gKVf/nm/vA=' 
WHERE 
  key_id = 'f746ef91ccc47809d23aac35cc161969c9fab2000863b37fee69051e0913ebce' 
  AND (
    token = 'zWxsGo8o0ny5Tbyd7XQxr3PgA3A7q3cC5gKVf/nm/vA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032