UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Jb+0JSijUtOyIgP7EXfHs+7Y4Rrd6dyo6q4gbqWLRU='
WHERE
key_id = '2f07cfec546bd94b7cfb16d87c6a0df4aaec22fdd1c0509451a186d27f75a075'
AND (
token = '/Jb+0JSijUtOyIgP7EXfHs+7Y4Rrd6dyo6q4gbqWLRU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)