UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ym4WixF6NFdiKkUZ7msbPqc8kZfOT+L1sqfx5bfS6Ko='
WHERE
key_id = '8624556e720c38b799f44436767d1da1eec40364d41f868122518aa394537cfb'
AND (
token = 'Ym4WixF6NFdiKkUZ7msbPqc8kZfOT+L1sqfx5bfS6Ko='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)