UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LzYuJj22pusQZ8ovNTJ8GR6GQ7axV9zhqhDhnaqTNiI='
WHERE
key_id = 'bba101e1e4850b5e6381d1ae75e698dfd8980ea9d11909e41278a6ac19d4df3f'
AND (
token = 'LzYuJj22pusQZ8ovNTJ8GR6GQ7axV9zhqhDhnaqTNiI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)