UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '41XpfIU7+lyHuSXIIML48toKYbE85hs1xToxlusT2H0='
WHERE
key_id = '105836578ec1ae7388397b85f0b404036adcda611423be222555a473213b958b'
AND (
token = '41XpfIU7+lyHuSXIIML48toKYbE85hs1xToxlusT2H0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)