UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Thzt49+N5GJNdNbYHYJGzHdgoq+Y2VNe0QCA5c3xdUE='
WHERE
key_id = '734711d7182b5f011f2c5088e8c3f8eeadf41d93645ed04882894605a651b5c7'
AND (
token = 'Thzt49+N5GJNdNbYHYJGzHdgoq+Y2VNe0QCA5c3xdUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)