UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T+j+YNw/r8X1sfqWE+ErBhKbITKm9TtPV+p76pjiI70='
WHERE
key_id = '02728c5ffb3a6e98bfc6ba516655c610535020962179a224a17af0ce440c1168'
AND (
token = 'T+j+YNw/r8X1sfqWE+ErBhKbITKm9TtPV+p76pjiI70='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)