UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z7RgYYbEFYgNj7wPYuBsylkT1jUOZokIEhiQIAHmO/c='
WHERE
key_id = '6558a0072c92c9d0f7baa86aa4b6967931f678a082607475b3daf191dcb1fb7f'
AND (
token = 'z7RgYYbEFYgNj7wPYuBsylkT1jUOZokIEhiQIAHmO/c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)