UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G8Os/jOqmkpX/84k9yavjyI9PJKDnRrur5L5H7lTcEY='
WHERE
key_id = '22b6679b9d6dc659ffd6e08551f4ddaa4c17d23e01807b1abd3e5d595ba7139c'
AND (
token = 'G8Os/jOqmkpX/84k9yavjyI9PJKDnRrur5L5H7lTcEY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)