UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'toAxrzhxJZklPPxQ+gnqKDba3EgP1/VJhLt6715hZ3I='
WHERE
key_id = '5ce609d7232857c9d11c1de65d07f3d962814c6787882315bfff485e80ef8c6a'
AND (
token = 'toAxrzhxJZklPPxQ+gnqKDba3EgP1/VJhLt6715hZ3I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)