UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3zKFtgxY1Xnrz+BDkgDnl18Zk6JQ3t9r6zBnggrKR8o=' 
WHERE 
  key_id = 'e982a5268e630bb9bc1770fd08d723144400a10e653d291812cc5fa477ec00c2' 
  AND (
    token = '3zKFtgxY1Xnrz+BDkgDnl18Zk6JQ3t9r6zBnggrKR8o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014