UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ai9SSSm6QpVtSWmOzNGVb0dKDaMeMF+ANt6NzMhSpds='
WHERE
key_id = 'afef4446d9a07ccb14b2396df12ca5181f8cb6a75535e2133e9bd4cf48ee19cd'
AND (
token = 'ai9SSSm6QpVtSWmOzNGVb0dKDaMeMF+ANt6NzMhSpds='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)