UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J7zszDakQWr44Vho2mOcve5xRitNlBP0U+Heh0l1XPU='
WHERE
key_id = 'd21afeb8488397862dc8880eac445cc03da9c8a3699e5463cdd36ea21dee5906'
AND (
token = 'J7zszDakQWr44Vho2mOcve5xRitNlBP0U+Heh0l1XPU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)