UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bvDpB254AKTLAxkbDMFIOeeiraAS3wqBs7Q7prUFwyA=' 
WHERE 
  key_id = 'a75a2734d76d3f80972e5aa0c37a44983d64d287556cd340ecb101c8739e411c' 
  AND (
    token = 'bvDpB254AKTLAxkbDMFIOeeiraAS3wqBs7Q7prUFwyA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048