UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8ATH0UXuYv2Ad/Goxgr08T4d5PWbRsVMoP370s7SuE8='
WHERE
key_id = '994406e423b5d9cb1962e5e8003db3358b22ed162fdfff9e3a3c7e58291c8393'
AND (
token = '8ATH0UXuYv2Ad/Goxgr08T4d5PWbRsVMoP370s7SuE8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)