UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b3SPmz4xqxuQlAaK9bRBf8GVNswFYA96ogGxFOt0M6Y='
WHERE
key_id = 'daa9219b10a666abc5bdd7ab5500f5ee0f09c7f303f42e25e881e72fb0d039fe'
AND (
token = 'b3SPmz4xqxuQlAaK9bRBf8GVNswFYA96ogGxFOt0M6Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)