UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CpuCoGnokxNQv+28ZTCr52GIUdq2ZLUdRCpIBirM2SA='
WHERE
key_id = '3322fb32ae62da7dee50da9a680f800bf02b032d196051eee0b913ed96cce92f'
AND (
token = 'CpuCoGnokxNQv+28ZTCr52GIUdq2ZLUdRCpIBirM2SA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)