UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QOt/4H8dN6mD4Vmw8mUz9+0F9y1vv+R54x6Mggw+Gb8='
WHERE
key_id = '11f6c2aa56b425b0228acbf228ba3506d301eb42dcad5991d9e71c56e9fc1915'
AND (
token = 'QOt/4H8dN6mD4Vmw8mUz9+0F9y1vv+R54x6Mggw+Gb8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)