UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dG8EsGtskuJ9fNDrrsrvWJH+zJ9y427sqjVCGOzytGo='
WHERE
key_id = '6e5a4b397687b18a22be489fb26bffe949a07b34deb4a980c9c732154cbe1c67'
AND (
token = 'dG8EsGtskuJ9fNDrrsrvWJH+zJ9y427sqjVCGOzytGo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)