UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'clnPZM16AHRJpfNnv245YE8QAPE/tpGrw0qUMKjhWds='
WHERE
key_id = '085ce6c872f25fa839556f68266b51208ea36beeca8020aabe26fe6282317586'
AND (
token = 'clnPZM16AHRJpfNnv245YE8QAPE/tpGrw0qUMKjhWds='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)