UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EfYpaU0P4tt4hOG9wRjLmICVoJ1Js9teF+7vPGCZQsw='
WHERE
key_id = '8ba6064d07d2f08d476ed9081b7525782cb116893dca3d3751165a9d5b5b4eee'
AND (
token = 'EfYpaU0P4tt4hOG9wRjLmICVoJ1Js9teF+7vPGCZQsw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)