UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oUD4sKYCd4aMgj7hBGF1DKYZTl583QW56qGg3RisRhM='
WHERE
key_id = 'ff6c1b23b52e6330f06b579ee8382b2c19054d9c2e9cacfdb8858c7f2d7ebe3a'
AND (
token = 'oUD4sKYCd4aMgj7hBGF1DKYZTl583QW56qGg3RisRhM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)