UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mHVPSqDJWMRKhN8yGHYQBqnLkIqOtN1B2Mz4F8EaRLE='
WHERE
key_id = '0b2509847809bc468c453320a3f4d96d34d9cea7e84fbf75f80cdd4e5ea7ca81'
AND (
token = 'mHVPSqDJWMRKhN8yGHYQBqnLkIqOtN1B2Mz4F8EaRLE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)