UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jGkT4cNueLHJR9+zHNpkbFR/xbZFFnidJ87GGwSr18c='
WHERE
key_id = 'abb9fef828f641bf7d11a5d296bcd9667e736a983040e886f8f1aac8802ead96'
AND (
token = 'jGkT4cNueLHJR9+zHNpkbFR/xbZFFnidJ87GGwSr18c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)