UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '41SpZMNevGz+UxjgUwSQbAe2RA0mYpsZYl42qgoPrMA='
WHERE
key_id = '5703e86d06f4f3f68cc2b5e254c04c21bf9297ad9ca9f66028de49d931559e58'
AND (
token = '41SpZMNevGz+UxjgUwSQbAe2RA0mYpsZYl42qgoPrMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)