UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lB+toom9ggmwcjGcFe77u/Oik6DWqF3kIPlnmamRLl8=' 
WHERE 
  key_id = '6231760c2d6e5e92baab5c7b1a3855c5af454f4039de556d65c70f0a66eec93a' 
  AND (
    token = 'lB+toom9ggmwcjGcFe77u/Oik6DWqF3kIPlnmamRLl8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025