UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jetVnevgt1GBFjkYYQ54aRFF/fqrUgq1P7KCtF0Mtlw='
WHERE
key_id = 'f12c02126b6cb05f649c860ca830b02895942474b9c5ddfb3814235babbc33ba'
AND (
token = 'jetVnevgt1GBFjkYYQ54aRFF/fqrUgq1P7KCtF0Mtlw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)