UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'juyHw5nkRYtQKXznnWHSKZwp2ummMoRbV/uo9P3zp3U='
WHERE
key_id = '36c6f8bd897508b0c358df6352d0e1db634929cb23cd557038e442f4d7c38e2b'
AND (
token = 'juyHw5nkRYtQKXznnWHSKZwp2ummMoRbV/uo9P3zp3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)