UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1kZ2bqjfXd2jWb9a6Vvjd2/EWk+PHchfwcXOabc/T+U='
WHERE
key_id = 'acebb8533b578b2e01ef6e527db4c58bd9be322beaee6513cc94b5ceee41d6f0'
AND (
token = '1kZ2bqjfXd2jWb9a6Vvjd2/EWk+PHchfwcXOabc/T+U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)