UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9aOCXsDZCM51Pr03PLOkqhL7UO5innZiLnX5+TrQOho='
WHERE
key_id = '305468c0d3b0fe3bff19456996b89f595eef271cd99d36413dad0a48616204c8'
AND (
token = '9aOCXsDZCM51Pr03PLOkqhL7UO5innZiLnX5+TrQOho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)