UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Hbo7F7S5s7CDQjSWgsZf69GTnlYBbm/2roGSY43S24='
WHERE
key_id = 'ce74d5a224658494b3934afd0f5d0d66556f170470bfb170f46aeee17d6999d2'
AND (
token = '5Hbo7F7S5s7CDQjSWgsZf69GTnlYBbm/2roGSY43S24='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)