UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SvO/5/lPyc2MyZyx41vAiYSCORdJZDQBE9FsXnynp7k='
WHERE
key_id = 'ddfb739952a0e0a98c882a0605c319f115db5f6071509888ab1b8035baffb35f'
AND (
token = 'SvO/5/lPyc2MyZyx41vAiYSCORdJZDQBE9FsXnynp7k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)