UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3OAe42aKhZ9Y+Sg23dbKrFj4gDXiJWEToU/KHgLWaYE=' 
WHERE 
  key_id = '77db3c0c2924c72a1f7261cc631f01128296dfd33b86ed58e51abb6ef3cebdc5' 
  AND (
    token = '3OAe42aKhZ9Y+Sg23dbKrFj4gDXiJWEToU/KHgLWaYE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058