UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KoMTwlZuPxgOhdFumCgZ77UHynm7JFKPhsSDZQe0x6U='
WHERE
key_id = '411f614d12a6b1b4d9f0490849003e7042838131f1cdeddeb78ce26f9e074104'
AND (
token = 'KoMTwlZuPxgOhdFumCgZ77UHynm7JFKPhsSDZQe0x6U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)