UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9MI2BIi0m+l2BXUVEgss1IxdUIsb3DIKVuWyN8xQmBI='
WHERE
key_id = '85149945646ff687e2af9cf731965a063d2a933f4ed3c6b4e6b9cb02b97b3ab9'
AND (
token = '9MI2BIi0m+l2BXUVEgss1IxdUIsb3DIKVuWyN8xQmBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)