UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hEa57T66GJdUf0Z9aDrpDSG1akR9OxPWtqetsHCLFEc='
WHERE
key_id = '8bf961ac834e813116ba2a4e4364b852bd4fe0152bd43b40d0867f49e8933549'
AND (
token = 'hEa57T66GJdUf0Z9aDrpDSG1akR9OxPWtqetsHCLFEc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)