UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mc7z9+dVA6StFp8twy9Ew1aO26ljuqbndUtFQmvnC/E='
WHERE
key_id = 'fa3a4ea4bceb33e4352e2ec5e81baa23c7d56a1259001fe864e5e65d39849fee'
AND (
token = 'Mc7z9+dVA6StFp8twy9Ew1aO26ljuqbndUtFQmvnC/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)