UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q9/JKvRtixNfQBIs2wTLtFG9GETixDSVd1db8RmBLtM=' 
WHERE 
  key_id = 'ec2828a574329e868dc297848b801d953bbfdd91e9002ab315244302e894217f' 
  AND (
    token = 'Q9/JKvRtixNfQBIs2wTLtFG9GETixDSVd1db8RmBLtM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029