UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0xOBo27EM/LQ3W+WEG5MB/JxZfWHhnJvZLVvDfr2Vr0='
WHERE
key_id = 'd274f65937433e72fef4c95e88f90473b37aaa88b8bedfd8f42f686b750e62b6'
AND (
token = '0xOBo27EM/LQ3W+WEG5MB/JxZfWHhnJvZLVvDfr2Vr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)