UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jJ4wAepk1RF2+CJHwkmK3Jh6YMvZesp5GIFAEqfVioQ='
WHERE
key_id = 'e5025a7dc46716c3f2e57011e3c6ab4402c08a3833610cf77d9dccbbd7f064a5'
AND (
token = 'jJ4wAepk1RF2+CJHwkmK3Jh6YMvZesp5GIFAEqfVioQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)