UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FHXlPnZlCApu3vX15sOygGV+ILAfk3xRGZFIFeMe3lg='
WHERE
key_id = 'faf682ec5d9b41f886b48126ef191676205d6b22eb1cff77ef65f8dd93814e15'
AND (
token = 'FHXlPnZlCApu3vX15sOygGV+ILAfk3xRGZFIFeMe3lg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)