UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rJqRGOPvVK/Qbxq1yfNf/kqZqqZ/bIx3R59GpgYuMl0='
WHERE
key_id = 'a278a96edb527dc64347254f179ffce7c0d4731e823c65c0ae207444a7ac7552'
AND (
token = 'rJqRGOPvVK/Qbxq1yfNf/kqZqqZ/bIx3R59GpgYuMl0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)