UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sVCkERcJ1egp2Am+1BN7YpgTRpuXJqZL5+wfImF5lfQ='
WHERE
key_id = '9bc1143d10963d34b5b2e8a81b462e4e30c051890630c85f5ae0410935fbebc3'
AND (
token = 'sVCkERcJ1egp2Am+1BN7YpgTRpuXJqZL5+wfImF5lfQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)